package com.qsh.ts.mem;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by sehuaqi on 2017/6/13.
 * 定义了一个Rest控制器，用于处理用户输入的请求。
 */
@RestController
public class MemController {

    private Logger logger = LoggerFactory.getLogger(MemController.class);

    @Autowired
    private MemService service;

    /**
     * 将请求的业务处理调用的Service接口的实现。
     * @return
     */
    @RequestMapping("/execute")
    public String execute(String name){

        logger.info(">>>>>将请求的业务处理调用的Service接口的实现");

        String message = service.execute(name);

        return message;
    }


    @RequestMapping("/login/{id}")
    public String login(@PathVariable int id){

        logger.info(">>>>>登录系统");

        String message = service.login(id);

        return message;
    }
}

